package com.example.im.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.example.im.entity.AccountInfo;

import java.util.List;

@Dao
public interface AccountInfoDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    Long insert(AccountInfo account);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(List<AccountInfo> accounts);

    @Update(onConflict = OnConflictStrategy.REPLACE)
    void update(AccountInfo account);

    @Delete
    void delete(AccountInfo account);

//    @Query("SELECT * FROM AccountInfo")
//    List<AccountInfo> loadAll();


    @Query("SELECT * FROM AccountInfo LIMIT 1")
    AccountInfo account();

}
